﻿

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>订单管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
</head>
<body>

    <div class="layui-fluid">

        <div class="layui-card">
            <div class="layui-form layui-card-header layuiadmin-card-header-auto">

                <div class="layui-form-item ">
                    <div class="layui-inline layui-col-lg2">
                        <label class="layui-form-label">量订单号</label>
                        <div class="layui-input-block">
                            <input type="text" name="lddocno" id="lddocno" placeholder="请输入量订单号" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline layui-col-lg2">
                        <label class="layui-form-label">店仓名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="dcname" id="dcname" placeholder="请输入店仓名称" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline layui-col-lg2">
                        <label class="layui-form-label">顾客姓名</label>
                        <div class="layui-input-block">
                            <input type="text" name="gkname" id="gkname" placeholder="请输入" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline layui-col-lg2">
                        <label class="layui-form-label">审批状态</label>
                        <div class="layui-input-block">
                            <select name="status" id="status">
                                <option value="">全部</option>
                                <option value="0" selected>未提交</option>
                                <option value="1">提交</option>
                                <option value="99">审核通过</option>
                            </select>
                        </div>
                    </div>
                    <!--<div class="layui-inline layui-col-lg2">
                        <label class="layui-form-label">流程状态</label>
                        <div class="layui-input-block">
                            <select name="lczt" id="lczt">
                                <option value="">全部</option>
                                <option value="0">待办</option>
                                <option value="2">已办</option>
                            </select>
                        </div>
                    </div>-->
                    <div class="layui-inline layui-col-lg1">
                        <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="LAY-user-front-search">
                            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                        </button>
                    </div>
                </div>

            </div>

            <div class="layui-card-body">
                <div style="padding-bottom: 10px;">
                    <!--<button class="layui-btn layuiadmin-btn-useradmin" data-type="batchdel">删除</button>-->
                    <button class="layui-btn layuiadmin-btn-useradmin" data-type="add">高定下单</button>
                    <button class="layui-btn" id="order_fx">
                        返修
                    </button>
                </div>

                <table id="LAY-user-manage" lay-filter="LAY-user-manage"></table>
                <script type="text/html" id="buttonTpl">
                    {{#  if(d.status == 99){ }}
                    <button class="layui-btn layui-btn-xs">已审核</button>
                    {{#  } else if(d.status == 1){ }}
                    <button class="layui-btn layui-btn-primary layui-btn-xs">已提交</button>
                    {{#  } else if(d.status == 0){ }}
                    <button class="layui-btn layui-btn-primary layui-btn-xs">未提交</button>
                    {{#  } else if(d.status == -1){ }}
                    <button class="layui-btn layui-btn-danger layui-btn-xs">驳回</button>
                    {{#  } else { }}
                    <button class="layui-btn layui-btn-primary layui-btn-xs">未审核</button>
                    {{#  } }}
                </script>

                <script type="text/html" id="test-table-operate-td">
                    {{#  if(d.status == 0){ }}
                    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
                    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
                    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
                    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="copy">复制订单</a>
                    {{#  } else if(d.status == -1){ }}
                    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
                    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
                    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
                    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="copy">复制订单</a>
                    {{#  } else { }}
                    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
                    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="copy">复制订单</a>
                    {{#  } }}
                </script>

                <script type="text/html" id="imgTpl">
                    <img style="display: inline-block; width: 50%; height: 100%;" src={{ d.avatar }}>
                </script>
            </div>
        </div>
    </div>
    <script src="../../layuiadmin/layui/layui.js"></script>
    <script src="../../layuiadmin/js/cookie.js"></script>
    <script>
        layui.config({
            base: '../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
            }).use(['index', 'useradmin', 'util', 'table', 'laypage','dropdown'], function () {
            var $ = layui.$
                , form = layui.form
                , table = layui.table
                , laypage = layui.laypage
                , util = layui.util
                , dropdown = layui.dropdown;

                $('#order_fx').hide();
            //验证用户是否登录
            if ($.cookie("loginid") == "" || $.cookie("loginid") == null || $.cookie("loginid") == "null" || $.cookie("loginid") == undefined || $.cookie("loginid") == "undefined") {
                $.removeCookie("id", { path: "/", sucue: true });//用户id
                $.removeCookie("loginid", { path: "/", sucue: true });//登录账号
                $.removeCookie("username", { path: "/", sucue: true });//用户名
                $.removeCookie("role", { path: "/", sucue: true });//权限
                $.removeCookie("islookme", { path: "/", sucue: true });//权限
                window.location.href = "../login/login.html";
                }
             //数据列表加载
            table.render({
                    elem: '#LAY-user-manage'
                    , id: 'testReload'//容器的ID
                    , url: 'ashx/list.ashx?type=getlist&userid=' + $.cookie("id") + '&islookmes=' + $.cookie("islookme")
                    , toolbar: '#test-table-radio-toolbarDemo'
                    , method: 'POST'
                    , page: true
                    , limits: [10, 20, 30]
                    , limit: 10
                    , cols: [[
                        { type: 'radio' }
                        , { field: 'id', width: 60, title: 'id', align: 'center' }
                        , { field: 'docno', width: 130, title: '单据编号', align: 'center' }
                        , { field: 'ld_docno', width: 160, title: '量订单号', align: 'center' }
                        , { field: 'store_name', width: 180, title: '店仓名称', align: 'center' }
                        , { field: 'customer_name', width: 100, title: '顾客姓名', align: 'center' }
                        , { field: 'product_value', width: 140, title: '款号', align: 'center' }
                        , { field: 'product_count', width: 80, title: '数量', align: 'center' }
                        , { field: 'status', width: 100, title: '状态', templet: '#buttonTpl', align: 'center' }
                        , { field: 'username', width: 90, title: '创建人', align: 'center' }
                        , { field: 'createtime', width: 160, title: '创建时间', align: 'center', sort: true }
                        , { field: 'zhczrname', width: 100, title: '最后操作人', align: 'center' }
                        , { field: 'zhcztime', width: 180, title: '最后操作时间', align: 'center', sort: true }
                        , { width: 230, align: 'center', fixed: 'right', toolbar: '#test-table-operate-td' }

                    ]], parseData: function (res) { //将原始数据解析成 table 组件所规定的数据.
                        return {
                            "code": res.code, //解析接口状态
                            "msg": res.msg, //解析提示文本
                            "count": res.count, //解析数据长度
                            "data": res.data //解析数据列表
                        };
                    }
                    , where: {
                        lddocno: $('#lddocno').val(),
                        dcname: $('#dcname').val(),
                        gkname: $('#gkname').val(),
                        status: $("select[name='status']").val()
                    }
                });
            //监听排序
            table.on('sort(LAY-user-manage)', function (obj) { //注：tool是工具条事件名，test是table原始容器的属性 lay-filter="对应的值"
                table.reload('testReload', {//刷新列表
                    initSort: obj //记录初始排序，如果不设的话，将无法标记表头的排序状态。 layui 2.1.1 新增参数
                    , where: { //请求参数
                        field: obj.field //排序字段
                        , order: obj.type //排序方式
                        , lddocno: $('#lddocno').val()
                        , dcname: $('#dcname').val()
                        , gkname: $('#gkname').val()
                        , status: $("select[name='status']").val()
                    }
                });
            });
            //单击行事件
                table.on('row(LAY-user-manage)', function (obj) {
                    var data = obj.data;
                    var ysddh = obj.data.ld_docno;
                    if (data.status == "99") {
                        $('#order_fx').show();
                        //无限层级
                        dropdown.render({
                            elem: '#order_fx'
                            , data: [{
                                title: '新增返修'
                                , templet: '<i class="layui-icon layui-icon-picture"></i> {{d.title}} '
                                , id: data.id
                                , href: '#'
                            }, {
                                title: '返修记录'
                                , templet: '<img src="//sentsin.gitee.io/res/images/demo/layer.png?t=123" style="width: 16px;"> {{d.title}}'
                                , id: data.id
                                , href: '#'
                               // , target: '_blank'
                            }]
                            , click: function (item) {
                                //layer.msg(util.escape(JSON.stringify(item)));
                                if (item.title == "新增返修") {
                                    layer.open({
                                        type: 2
                                        , title: '新增返修'
                                        , content: '../orderRework/add.html?id=' + item.id
                                        , maxmin: true
                                        , area: ['700px', '750px']
                                        , btn: ['保存','提交', '取消']
                                        , yes: function (index, layero) {
                                            var iframeWindow = window['layui-layer-iframe' + index]
                                                , submitID = 'LAY-user-front-submit'
                                                , submit = layero.find('iframe').contents().find('#' + submitID);
                                            //监听提交
                                            iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
                                                debugger
                                                var obj = $(layero).find("iframe")[0].contentWindow;
                                                var txt_ysdbh = obj.$("#txt_ysdbh").val();//预收单单号
                                                var txt_djbh = obj.$("#txt_djbh").val();//量定单号
                                                var txt_name = obj.$("#txt_name").val();//品名
                                                var txt_kh = obj.$("#txt_kh").val();//款号
                                                var txt_sl = obj.$("#txt_sl").val();//数量
                                                var txt_remark = obj.$("#txt_remark").val();//返修原因
                                                var fx_pic = obj.urls;//返修图片

                                                var arr = new Array();
                                                if (txt_ysdbh == "" || txt_ysdbh == null || txt_ysdbh == undefined) {
                                                    layer.msg('请填写预收单号', { icon: 5 });
                                                    return;
                                                }
                                                if (txt_djbh == "" || txt_djbh == null || txt_djbh == undefined) {
                                                    layer.msg('请填写单据编号', { icon: 5 });
                                                    return;
                                                }
                                                if (txt_name == "" || txt_name == null || txt_name == undefined) {
                                                    layer.msg('请填写返修名称', { icon: 5 });
                                                    return;
                                                }
                                                if (txt_kh == "" || txt_kh == null || txt_kh == undefined) {
                                                    layer.msg('请填写返修款号', { icon: 5 });
                                                    return;
                                                }
                                          
                                                if (txt_ysdbh != "") {
                                                    var add = {
                                                        "creater": $.cookie("id"),
                                                        "username": $.cookie("username"),
                                                        "ysdbh": txt_ysdbh,
                                                        "djbh": txt_djbh,
                                                        "name": txt_name,
                                                        "kh": txt_kh,
                                                        "sl": txt_sl,
                                                        "remark": txt_remark,
                                                        "pic": fx_pic
                                                    };
                                                    arr.push(add);
                                                    $.ajax({
                                                        url: '../orderRework/ashx/list.ashx?type=add&lx=save',
                                                        type: "post",
                                                        contentType: "application/json",
                                                        dataType: "json",
                                                        data: JSON.stringify({ 'LoadData_type': arr }),
                                                        success: function (res) {
                                                            if (res.flag == "True") {
                                                                layer.close(index);
                                                                layer.msg(res.remsg, {
                                                                    time: 2000,
                                                                    end: function () {
                                                                        //执行重载
                                                                        //table.reload('testReload', {
                                                                        //    where: {
                                                                        //        functionname: $('#rolesname').val(),
                                                                        //        sel_isactive: $('#sel_isactive').val()
                                                                        //    }, page: {
                                                                        //        curr: 1 //重新从第 1 页开始
                                                                        //    }
                                                                        //});
                                                                    }
                                                                })
                                                            }
                                                            else {
                                                                layer.alert(res.remsg);
                                                            }
                                                        }
                                                    })
                                                }
                                            });
                                            submit.trigger('click');
                                        }
                                        , btn2: function (index, layero) {
                                            var iframeWindow = window['layui-layer-iframe' + index]
                                                , submitID = 'LAY-user-front-submit'
                                                , submit = layero.find('iframe').contents().find('#' + submitID);
                                            //监听提交
                                            iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
                                                var obj = $(layero).find("iframe")[0].contentWindow;
                                                var txt_ysdbh = obj.$("#txt_ysdbh").val();//预收单单号
                                                var txt_djbh = obj.$("#txt_djbh").val();//量定单号
                                                var txt_name = obj.$("#txt_name").val();//品名
                                                var txt_kh = obj.$("#txt_kh").val();//款号
                                                var txt_sl = obj.$("#txt_sl").val();//数量
                                                var txt_remark = obj.$("#txt_remark").val();//返修原因
                                                var fx_pic = obj.urls;//返修图片

                                                var arr = new Array();
                                                if (txt_ysdbh == "" || txt_ysdbh == null || txt_ysdbh == undefined) {
                                                    layer.msg('请填写预收单号', { icon: 5 });
                                                    return;
                                                }
                                                if (txt_djbh == "" || txt_djbh == null || txt_djbh == undefined) {
                                                    layer.msg('请填写单据编号', { icon: 5 });
                                                    return;
                                                }
                                                if (txt_name == "" || txt_name == null || txt_name == undefined) {
                                                    layer.msg('请填写返修名称', { icon: 5 });
                                                    return;
                                                }
                                                if (txt_kh == "" || txt_kh == null || txt_kh == undefined) {
                                                    layer.msg('请填写返修款号', { icon: 5 });
                                                    return;
                                                }
                                                if (txt_sl == "" || txt_sl == null || txt_sl == undefined) {
                                                    layer.msg('请填写返修数量', { icon: 5 });
                                                    return;
                                                }
                                                else if (parseInt(txt_sl) < 1) {
                                                    layer.msg('数量不能小于1', { icon: 5 });
                                                    return;
                                                }
                                                if (txt_remark == "" || txt_remark == null || txt_remark == undefined) {
                                                    layer.msg('请填写返修原因', { icon: 5 });
                                                    return;
                                                }
                                                if (txt_remark != "") {
                                                    var add = {
                                                        "creater": $.cookie("id"),
                                                        "username": $.cookie("username"),
                                                        "ysdbh": txt_ysdbh,
                                                        "djbh": txt_djbh,
                                                        "name": txt_name,
                                                        "kh": txt_kh,
                                                        "sl": txt_sl,
                                                        "remark": txt_remark,
                                                        "pic": fx_pic
                                                    };
                                                    arr.push(add);
                                                    $.ajax({
                                                        url: '../orderRework/ashx/list.ashx?type=add&lx=save',
                                                        type: "post",
                                                        contentType: "application/json",
                                                        dataType: "json",
                                                        data: JSON.stringify({ 'LoadData_type': arr }),
                                                        success: function (res) {
                                                            if (res.flag == "True") {
                                                                layer.close(index);
                                                                layer.msg(res.remsg, {
                                                                    time: 2000,
                                                                    end: function () {
                                                                        //执行重载
                                                                        //table.reload('testReload', {
                                                                        //    where: {
                                                                        //        functionname: $('#rolesname').val(),
                                                                        //        sel_isactive: $('#sel_isactive').val()
                                                                        //    }, page: {
                                                                        //        curr: 1 //重新从第 1 页开始
                                                                        //    }
                                                                        //});
                                                                    }
                                                                })
                                                            }
                                                            else {
                                                                layer.alert(res.remsg);
                                                            }
                                                        }
                                                    })
                                                }
                                            });
                                            submit.trigger('click');
                                        }
                                    }); 
                                }
                                if (item.title == "返修记录") {
                                    layer.open({
                                        type: 2
                                        , title: '查看'
                                        , content: '../orderRework/rework_ls.html?&ysd_docno=' + ysddh
                                        , maxmin: true
                                        , area: [($(window).width() * 0.7) + 'px', ($(window).height() * 0.7) + 'px']
                                        , cancel: function (index, layero) {

                                        },
                                        end: function () {

                                        }
                                    });
                                }
                            }
                        });
                    }
                    else {
                        $('#order_fx').hide();
                    }
                //标注选中样式
                obj.tr.addClass('layui-table-click').siblings().removeClass('layui-table-click');
                //选中radio样式
                obj.tr.find('i[class="layui-anim layui-icon"]').trigger("click");
                });
            //双击行事件
            table.on('rowDouble(LAY-user-manage)', function (obj) {
                //console.log(obj.tr) //得到当前行元素对象
                //console.log(obj.data) //得到当前行数据
                layer.open({
                    type: 2
                    , title: '查看'
                    , content: 'select_ls.html?&dj_docno=' + obj.data.docno 
                    , maxmin: true
                    , area: [($(window).width() * 0.7) + 'px', ($(window).height() * 0.7) + 'px']
                    , cancel: function (index, layero) {

                    },
                    end: function () {

                    }
                });
                //obj.del(); //删除当前行
                //obj.update(fields) //修改当前行数据
            });
            //监听工具条
            table.on('tool(LAY-user-manage)', function (obj) {
                var data = obj.data;
                //查看明细
                if (obj.event === 'detail') {
                    var index = layer.open({
                        type: 2
                        , title: '查看'
                        , content: 'edit.html?type=view&editid=' + data.id + '&djbhs=' + data.docno
                        , maxmin: true
                        , area: [($(window).width() * 1) + 'px', ($(window).height() * 1) + 'px']
                        , cancel: function (index, layero) {

                        },
                        end: function () {

                        }
                    });
                    layer.full(index);
                }
                //删除，实际是改为不可用
                else if (obj.event === 'del') {
                    layer.confirm('您确定要删除吗', function (index) {
                        $.ajax({
                            url: 'ashx/list.ashx?type=delete&getids=' + data.id + '&lddocno=' + data.docno + '&userid=' + $.cookie("id") + '&usernames=' + $.cookie("username"),
                            type: "post",
                            contentType: "application/json",
                            dataType: "json",
                            data: {},
                            success: function (res) {
                                var index = parent.layer.getFrameIndex(window.name);
                                if (res.flag == "True") {
                                    layer.msg(res.remsg, {
                                        time: 2000,
                                        end: function () {
                                            table.reload('testReload', {//刷新列表
                                                where: { //请求参数
                                                    lddocno: $('#lddocno').val()
                                                    , dcname: $('#dcname').val()
                                                    , gkname: $('#gkname').val()
                                                    , status: $("select[name='status']").val()
                                                }
                                            });
                                        }
                                    })
                                }
                                else {
                                    layer.alert(res.remsg);
                                }
                            }
                        });
                    });
                }
                //修改
                else if (obj.event === 'edit') {
                    var index = layer.open({
                        type: 2
                        , title: '修改'
                        , content: 'edit.html?type=edit&editid=' + data.id + '&djbhs=' + data.docno
                        , maxmin: true
                        , area: [($(window).width() * 1) + 'px', ($(window).height() * 1) + 'px']
                        , cancel: function (index, layero) {
                            //取消的操作
                            var body = layer.getChildFrame('body', index);
                            var iframeWin = window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象，执行iframe页的方法：
                            var content = layero.find("iframe")[0].contentWindow.$("#lbl_ysdh").text();
                            if (content == "" || content == null || content == undefined) {

                            }
                            else {
                                //iframeWin.submit('save');//调用子页面的方法，得到子页面返回的ids
                                layer.close(index);//需要手动关闭窗口
                            }
                        },
                        end: function () {
                            table.reload('testReload', {//刷新列表
                                where: { //请求参数
                                    lddocno: $('#lddocno').val()
                                    , dcname: $('#dcname').val()
                                    , gkname: $('#gkname').val()
                                    , status: $("select[name='status']").val()
                                }
                            });
                        }
                    });
                    layer.full(index);
                    //layer.alert('编辑行：<br>' + JSON.stringify(data))
                }
                //复制订单
                else if (obj.event === 'copy') {
                    layer.confirm('您确定要复制吗', function (index) {
                        $.ajax({
                            url: 'ashx/list.ashx?type=copy&getids=' + data.id,
                            type: "post",
                            contentType: "application/json",
                            dataType: "json",
                            data: {},
                            success: function (res) {
                                var index = parent.layer.getFrameIndex(window.name);
                                if (res.flag == "True") {
                                    layer.msg(res.remsg, {
                                        time: 2000,
                                        end: function () {
                                            table.reload('testReload', {//刷新列表
                                                where: { //请求参数
                                                    lddocno: $('#lddocno').val()
                                                    , dcname: $('#dcname').val()
                                                    , gkname: $('#gkname').val()
                                                    , status: $("select[name='status']").val()
                                                }
                                            });
                                        }
                                    })
                                }
                                else {
                                    layer.alert(res.remsg);
                                }
                            }
                        });
                    });
                }
            });
            //监听搜索
            form.on('submit(LAY-user-front-search)', function (data) {
                var field = data.field;
                //执行重载
                table.reload('testReload', {
                    where: {
                        lddocno: field.lddocno,
                        dcname: field.dcname,
                        gkname: field.gkname,
                        status: $("select[name='status']").val()

                    }, page: {
                        curr: 1 //重新从第 1 页开始
                    }
                });
            });
            function getRowFexId(value) {
                var checkStatus = table.checkStatus('testReload')
                    , data = checkStatus.data, arr = new Array();;
                for (var i = 0; i < data.length; i++) {
                    arr.push(data[i][value]);
                }
                return arr.join(",");
            }
            //事件
            var active = {
                batchdel: function () {
                    var checkStatus = table.checkStatus('testReload')
                        , checkData = checkStatus.data; //得到选中的数据
                    if (checkData.length === 0) {
                        return layer.msg('请选择数据');
                    }
                    var getid = getRowFexId("id");
                    layer.confirm('确定删除吗？', function (index) {
                        //执行 Ajax 后重载
                        $.ajax({
                            url: 'ashx/list.ashx?type=delete&getids=' + getid,
                            type: "post",
                            contentType: "application/json",
                            dataType: "json",
                            data: {},
                            success: function (res) {
                                var index = parent.layer.getFrameIndex(window.name);
                                if (res.flag == "True") {
                                    layer.msg(res.remsg, {
                                        time: 2000,
                                        end: function () {
                                            table.reload('testReload', {//刷新列表
                                                where: { //请求参数
                                                    lddocno: $('#lddocno').val()
                                                    , dcname: $('#dcname').val()
                                                    , gkname: $('#gkname').val()
                                                    , status: $("select[name='status']").val()
                                                }
                                            });
                                        }
                                    })
                                }
                                else {
                                    layer.alert(res.remsg);
                                }
                            }
                        });
                    });


                }
                , add: function () {
                    var index = layer.open({
                        type: 2
                        , title: '新增订单'
                        , content: 'add.html'
                        , maxmin: true
                        , area: [($(window).width() * 0.5) + 'px', ($(window).height() * 0.5) + 'px']
                        , cancel: function (index, layero) {
                            //取消的操作
                            var body = layer.getChildFrame('body', index);
                            var iframeWin = window[layero.find('iframe')[0]['name']];//得到iframe页的窗口对象，执行iframe页的方法：
                            var content = layero.find("iframe")[0].contentWindow.$("#lbl_ysdh").text();
                            if (content == "" || content == null || content == undefined) {
                            }
                            else {
                                //iframeWin.submit('save');//调用子页面的方法，得到子页面返回的ids
                                layer.close(index);//需要手动关闭窗口
                            }
                        },
                        end: function () {
                            table.reload('testReload', {//刷新列表
                                where: { //请求参数
                                    lddocno: $('#lddocno').val()
                                    , dcname: $('#dcname').val()
                                    , gkname: $('#gkname').val()
                                    , status: $("select[name='status']").val()
                                }
                            });
                        }
                    });
                    layer.full(index);
                }
            };

            $('.layui-btn.layuiadmin-btn-useradmin').on('click', function () {
                var type = $(this).data('type');
                active[type] ? active[type].call(this) : '';
            });
        });
    </script>
</body>
</html>
